<script setup lang="ts">
import {useRouter} from "vue-router";

const  User = {

  username: "颜嘉铭",
  userAccount: "lzk",
  avatarUrl: "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
  gender: "男",
  phone: '1233212',
  email: '2323213213',
  createTime: new Date(),
  address: '北京天安门',
  palnetCode: '12321'
};
const router = useRouter();
const edit = (editKey:string,label:string,currentValue:string)=>{
  router.push(
      {
        path: "/user/edit",

        query:{
          editKey,
          label,
          currentValue
        }
      }
  );
}
</script>

<template>
  <van-cell title="账号" is-link  @click="edit('userAccount','账号',User.userAccount)" :value="User.userAccount"/>
  <van-cell title="用户名" is-link  @click="edit('username','用户名',User.username)" :value="User.username" />
  <van-cell title="头像" is-link t  @click="edit('avatarUrl','头像',User.avatarUrl)" >
    <img :src="User.avatarUrl" style="height: 48px">
  </van-cell>
  <van-cell title="性别" is-link   :value="User.gender"  @click="edit('gender','性别',User.gender)"/>
  <van-cell title="手机号" is-link  :value="User.phone" @click="edit('phone','手机',User.phone)"/>
  <van-cell title="邮箱" is-link    :value="User.email" @click="edit('email','邮箱',User.email)"/>
  <van-cell title="创建时间" is-link    :value="User.createTime" />
  <van-cell title="住址" is-link    :value="User.address" @click="edit('address','住址',User.address)"/>

  <van-cell title="星球标号" is-link    :value="User.palnetCode" @click="edit('palnetCode','星球编号',User.palnetCode)" />
</template>

<style scoped>

</style>